package com.qq.weixin.mp.message.hxexp.model.receive;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import com.hxexp.weixin.common.jaxb.CDATAAdapter;

/**
 * 支付结果通知
 * @author li.jiang
 *
 */
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)
public final class PayNotifyJaxb implements Serializable {

    private static final long serialVersionUID = 2587744689877994747L;
    /**
     * 返回状态码 (SUCCESS/FAIL 此字段是通信标识，非交易标识，交易是否成功需要查看result_code来判断 )
     */
    @XmlElement(name = "return_code")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String returnCode;
    /**
     * 返回信息 (如非空，为错误原因 )
     */
    @XmlElement(name = "return_msg")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String returnMsg;
    /**
     * 公众账号ID
     */
    @XmlElement(name = "appid")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String appId;
    /**
     * 商户号
     */
    @XmlElement(name = "mch_id")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String mchId;
    /**
     * 随机字符串，不长于32位
     */
    @XmlElement(name = "nonce_str")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String nonceStr;
    /**
     * 签名
     */
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String sign;
    /**
     * 业务结果 (SUCCESS/FAIL)
     */
    @XmlElement(name = "result_code")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String resultCode;
    /**
     * 错误代码
     */
    @XmlElement(name = "err_code")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String errCode;
    /**
     * 错误代码描述
     */
    @XmlElement(name = "err_code_des")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String errCodeDes;
    /**
     * 设备号【调用接口提交的终端设备号】
     */
    @XmlElement(name = "device_info")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String deviceInfo;
    /**
     * 用户标识(用户在商户appid下的唯一标识)
     */
    @XmlElement(name = "openid")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String openId;
    /**
     * 用户是否关注公众账号(，Y-关注，N-未关注，仅在公众账号类型支付有效)
     */
    @XmlElement(name = "is_subscribe")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String isSubscribe;
    /**
     * 交易类型
     */
    @XmlElement(name = "trade_type")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String tradeType;
    /**
     * 付款银行(采用字符串类型的银行标识)
     */
    @XmlElement(name = "bank_type")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String bankType;
    /**
     * 总金额，单位为分
     */
    @XmlElement(name = "total_fee")
    private Integer totalFee;
    /**
     * 现金券金额, 现金券支付金额<=订单总金额，订单总金额-现金券金额为现金支付金额
     */
    @XmlElement(name = "coupon_fee")
    private Integer couponFee;
    /**
     * 货币种类
     */
    @XmlElement(name = "fee_type")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String feeType;
    /**
     * 微信支付订单号
     */
    @XmlElement(name = "transaction_id")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String transactionId;
    /**
     * 商户订单号(最长32位，可包含字母，微信支付要求商户订单号保持唯一性)
     */
    @XmlElement(name = "out_trade_no")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String outTradeNo;
    /**
     * 商家数据包,原样返回
     */
    @XmlElement(name = "attach")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String attach;
    /**
     * 支付完成时间，yyyyMMddhhmmss
     */
    @XmlElement(name = "time_end")
    @XmlJavaTypeAdapter(value = CDATAAdapter.class)
    private String timeEnd;
    /**
     * @return the returnCode
     */
    public String getReturnCode() {
        return returnCode;
    }
    /**
     * @param returnCode the returnCode to set
     */
    public void setReturnCode(String returnCode) {
        this.returnCode = returnCode;
    }
    /**
     * @return the returnMsg
     */
    public String getReturnMsg() {
        return returnMsg;
    }
    /**
     * @param returnMsg the returnMsg to set
     */
    public void setReturnMsg(String returnMsg) {
        this.returnMsg = returnMsg;
    }
    /**
     * @return the appId
     */
    public String getAppId() {
        return appId;
    }
    /**
     * @param appId the appId to set
     */
    public void setAppId(String appId) {
        this.appId = appId;
    }
    /**
     * @return the mchId
     */
    public String getMchId() {
        return mchId;
    }
    /**
     * @param mchId the mchId to set
     */
    public void setMchId(String mchId) {
        this.mchId = mchId;
    }
    /**
     * @return the nonceStr
     */
    public String getNonceStr() {
        return nonceStr;
    }
    /**
     * @param nonceStr the nonceStr to set
     */
    public void setNonceStr(String nonceStr) {
        this.nonceStr = nonceStr;
    }
    /**
     * @return the sign
     */
    public String getSign() {
        return sign;
    }
    /**
     * @param sign the sign to set
     */
    public void setSign(String sign) {
        this.sign = sign;
    }
    /**
     * @return the resultCode
     */
    public String getResultCode() {
        return resultCode;
    }
    /**
     * @param resultCode the resultCode to set
     */
    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }
    /**
     * @return the errCode
     */
    public String getErrCode() {
        return errCode;
    }
    /**
     * @param errCode the errCode to set
     */
    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }
    /**
     * @return the errCodeDes
     */
    public String getErrCodeDes() {
        return errCodeDes;
    }
    /**
     * @param errCodeDes the errCodeDes to set
     */
    public void setErrCodeDes(String errCodeDes) {
        this.errCodeDes = errCodeDes;
    }
    /**
     * @return the deviceInfo
     */
    public String getDeviceInfo() {
        return deviceInfo;
    }
    /**
     * @param deviceInfo the deviceInfo to set
     */
    public void setDeviceInfo(String deviceInfo) {
        this.deviceInfo = deviceInfo;
    }
    /**
     * @return the openId
     */
    public String getOpenId() {
        return openId;
    }
    /**
     * @param openId the openId to set
     */
    public void setOpenId(String openId) {
        this.openId = openId;
    }
    /**
     * @return the isSubscribe
     */
    public String getIsSubscribe() {
        return isSubscribe;
    }
    /**
     * @param isSubscribe the isSubscribe to set
     */
    public void setIsSubscribe(String isSubscribe) {
        this.isSubscribe = isSubscribe;
    }
    /**
     * @return the tradeType
     */
    public String getTradeType() {
        return tradeType;
    }
    /**
     * @param tradeType the tradeType to set
     */
    public void setTradeType(String tradeType) {
        this.tradeType = tradeType;
    }
    /**
     * @return the bankType
     */
    public String getBankType() {
        return bankType;
    }
    /**
     * @param bankType the bankType to set
     */
    public void setBankType(String bankType) {
        this.bankType = bankType;
    }
    /**
     * @return the totalFee
     */
    public Integer getTotalFee() {
        return totalFee;
    }
    /**
     * @param totalFee the totalFee to set
     */
    public void setTotalFee(Integer totalFee) {
        this.totalFee = totalFee;
    }
    /**
     * @return the couponFee
     */
    public Integer getCouponFee() {
        return couponFee;
    }
    /**
     * @param couponFee the couponFee to set
     */
    public void setCouponFee(Integer couponFee) {
        this.couponFee = couponFee;
    }
    /**
     * @return the feeType
     */
    public String getFeeType() {
        return feeType;
    }
    /**
     * @param feeType the feeType to set
     */
    public void setFeeType(String feeType) {
        this.feeType = feeType;
    }
    /**
     * @return the transactionId
     */
    public String getTransactionId() {
        return transactionId;
    }
    /**
     * @param transactionId the transactionId to set
     */
    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }
    /**
     * @return the outTradeNo
     */
    public String getOutTradeNo() {
        return outTradeNo;
    }
    /**
     * @param outTradeNo the outTradeNo to set
     */
    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }
    /**
     * @return the attach
     */
    public String getAttach() {
        return attach;
    }
    /**
     * @param attach the attach to set
     */
    public void setAttach(String attach) {
        this.attach = attach;
    }
    /**
     * @return the timeEnd
     */
    public String getTimeEnd() {
        return timeEnd;
    }
    /**
     * @param timeEnd the timeEnd to set
     */
    public void setTimeEnd(String timeEnd) {
        this.timeEnd = timeEnd;
    }
    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return String
                .format("PayNotify [returnCode=%s, returnMsg=%s, appId=%s, mchId=%s, nonceStr=%s, sign=%s, resultCode=%s, errCode=%s, errCodeDes=%s, deviceInfo=%s, openId=%s, isSubscribe=%s, tradeType=%s, bankType=%s, totalFee=%s, couponFee=%s, feeType=%s, transactionId=%s, outTradeNo=%s, attach=%s, timeEnd=%s]",
                        returnCode, returnMsg, appId, mchId, nonceStr, sign, resultCode, errCode, errCodeDes,
                        deviceInfo, openId, isSubscribe, tradeType, bankType, totalFee, couponFee, feeType,
                        transactionId, outTradeNo, attach, timeEnd);
    }

}
